#include "kernel.h"
#include "assert.h"

static u8 buf[1024];

void spin(const char* name, ...)
{
    printk("spin in %s ...\n", name);
    while (true)
    {
        asm volatile("hlt");
    }
}

void panic(const char* name)
{
    printk(name);
    while (true)
    {
        asm volatile("hlt");
    }
    
}

void assertion_failure(char* exp, char* file, char* base_file, int line)
{
    printk("[%s->0x%x:%d]assert(%s) failed", file, base_file, line, exp);
    spin("assertion_failure()");
}